home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / lfsSegLayout.h < prev    next >
C/C++ Source or Header  |  1990-10-19  |  2KB  |  62 lines

  1. /*
  2.  * lfsSegLayout.h --
  3.  *
  4.  *    Declarations of the structures defining the resident image
  5.  *    of an LFS segment. An LFS segment is divided into two 
  6.  *    regions the summary region and data block region. The
  7.  *    summary region is used the identify the blocks in the data 
  8.  *    block region during clean and aid in crash recovery.
  9.  *
  10.  * Copyright 1989 Regents of the University of California
  11.  * Permission to use, copy, modify, and distribute this
  12.  * software and its documentation for any purpose and without
  13.  * fee is hereby granted, provided that the above copyright
  14.  * notice appear in all copies.  The University of California
  15.  * makes no representations about the suitability of this
  16.  * software for any purpose.  It is provided "as is" without
  17.  * express or implied warranty.
  18.  *
  19.  * $Header: /sprite/src/kernel/lfs/RCS/lfsSegLayout.h,v 1.4 90/10/19 17:23:02 mendel Exp $ SPRITE (Berkeley)
  20.  */
  21.  
  22. #ifndef _LFSSEGLAYOUT
  23. #define _LFSSEGLAYOUT
  24.  
  25.  
  26. /*
  27.  * The summary area of each segment contains a LfsSegSummary structured 
  28.  * followed by Lfs*Summary for each region type with blocks in the segment.
  29.  * Each region summary type is started by a LfsSegSummaryHdr.
  30.  */
  31. typedef struct LfsSegSummary {
  32.     unsigned int  magic;    /* Better be LFS_SEG_SUMMARY_MAGIC. */
  33.     unsigned int  timestamp;    /* Timestamp of last write. */
  34.     unsigned int  prevSeg;      /* The previous segment written. */
  35.     unsigned int  nextSeg;      /* The next segment to write. */
  36.     int  size;            /* The size of this segment's summary region
  37.                  * in bytes including this structure. */
  38.     int nextSummaryBlock;    /* The block offset of the next summary block 
  39.                  * in this segment segment. -1 if this is the
  40.                  * last summary block in this segment. */
  41. } LfsSegSummary;
  42.  
  43. #define    LFS_SEG_SUMMARY_MAGIC    0x1065e6    /* logseg */
  44.  
  45. typedef struct LfsSegSummaryHdr {
  46.     unsigned short moduleType;       /* Module type of this summary region. */
  47.     unsigned short lengthInBytes;  /* Length of this summary region in bytes. */
  48.     int   numDataBlocks;       /* Number data blocks described by this 
  49.                     * region. */
  50. } LfsSegSummaryHdr;
  51.  
  52. /*
  53.  * A list of module type and their priorities. 
  54.  */
  55. #define    LFS_FILE_LAYOUT_MOD 0
  56. #define    LFS_DESC_MAP_MOD    1
  57. #define    LFS_SEG_USAGE_MOD   2
  58. #define    LFS_MAX_NUM_MODS    3
  59.  
  60. #endif /* _LFSSEGLAYOUT */
  61.  
  62.